package cn.tedu.yl.news_bulletin.controller;

import cn.tedu.yl.base.response.JsonResult;
import cn.tedu.yl.cost.pojo.vo.CostVO;
import cn.tedu.yl.news_bulletin.pojo.dto.News_bulletinParam;
import cn.tedu.yl.news_bulletin.pojo.dto.News_bulletinQuery;
import cn.tedu.yl.news_bulletin.pojo.vo.news_bulletinVO;
import cn.tedu.yl.news_bulletin.service.News_bulletinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/v1/news_bulletin")
public class news_bulletinController {
    @Autowired
    private News_bulletinService news_bulletinService;


    @GetMapping("select")
    public JsonResult select(News_bulletinQuery news_bulletinQuery){
        List<news_bulletinVO> list = news_bulletinService.select(news_bulletinQuery);
        return JsonResult.ok(list);
    }

    @PostMapping("save")
    public JsonResult save(News_bulletinParam news_bulletinParam){
        news_bulletinService.save(news_bulletinParam);
        return JsonResult.ok();
    }

}
